CXX = g++
OPT = -O3 -fopenmp
CXXFLAGS = -std=c++11 -Wall -Wextra -Weffc++ -Werror=uninitialized -Werror=return-type -Wconversion -Wsign-compare -Werror=unused-result -Werror=suggest-override -Wzero-as-null-pointer-constant -Wmissing-declarations -Wold-style-cast -Wnon-virtual-dtor -Werror -I./concurrentqueue_x64-linux/include
LDFLAGS = -fopenmp

targets = gen_data optimized
objects = main.o pub_defs.o calc_xv_baseline.o gen_data.o baseline.o optimized.o calc_xv_optimized.o

.PHONY : default
default : all

all: $(targets)

gen_data: gen_data.o calc_xv_baseline.o pub_defs.o
	${CXX} ${LDFLAGS} -o $@ $^

baseline: baseline.o calc_xv_baseline.o pub_defs.o
	${CXX} ${LDFLAGS} -o $@ $^

optimized: optimized.o calc_xv_optimized.o pub_defs.o
	${CXX} ${LDFLAGS} -o $@ $^

%.o:%.cpp
	${CXX} ${CXXLAGS} ${OPT} -c -o $@ $^

.PHONY : clean
clean:
	rm -f $(targets) $(objects) *.bin
